 ///
 /// @file    deleter.cc
 /// @author  lemon(haohb13@gmail.com)
 /// @date    2016-03-12 10:51:08
 ///
 
#include <stdio.h>
#include <iostream>
#include <memory>

using std::cout;
using std::endl;


struct Fpcloser
{
	void operator()(FILE * fp)
	{
		if(fp)
		{
			cout << "close file pointer " << endl;
			fclose(fp);
		}
	}
};

void fpclose(FILE *fp)
{
	if(fp)
	{
		cout << "close file pointer " << endl;
		fclose(fp);
	}
}


int main(void)
{
	std::unique_ptr<FILE, Fpcloser> spFile(fopen("Point.cc", "r"),
		Fpcloser());
}
